//
//  BSZButton.m
//  BuSuanZi
//
//  Created by HZ on 2025/2/15.
//

#import "BSZButton.h"

@implementation BSZButton

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.adjustsImageWhenHighlighted = NO;
    }
    return self;
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect{
    if (!CGRectIsEmpty(self.titleRect) && !CGRectEqualToRect(self.titleRect, CGRectZero)) {
        return self.titleRect;
    }else{
        return [super titleRectForContentRect:contentRect];
    }
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    if (!CGRectIsEmpty(self.imageRect) && !CGRectEqualToRect(self.imageRect, CGRectZero)) {
        return self.imageRect;
    }else{
        return [super imageRectForContentRect:contentRect];
    }
}

@end
